package br.gov.mi.corporativo.dominio.boundary.comum.instituicaoensino;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import br.gov.mi.corporativo.dominio.entidade.comum.InstituicaoEnsino;

@Path("instituicoes")
public class InstituicaoEnsinoRestAdapter extends SpringBeanAutowiringSupport {


	@Autowired
	private InstituicaoEnsinoEndPoint service;
	
	@GET
	@Produces({MediaType.APPLICATION_JSON})
	public Iterable<InstituicaoEnsino> recuperarTodos(){
		return service.recuperarTodos();
	}

	@GET
	@Path("/id/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public InstituicaoEnsino recuperarPorId(@PathParam("id")Long id){
		return service.recuperarPorId(id);
	}
	
	@GET
	@Path("/idPj/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public List<InstituicaoEnsino> recuperarPorPessoaJuridica(@PathParam("idPj")Long id){
		return service.recuperarPorPessoaJuridica(id);
	}
	
	
}
